﻿using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
using Volo.Abp.BackgroundJobs;
using Microsoft.Extensions.Configuration;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.BackgroundWorkers;

namespace Himp.TaskScheduling;

[DependsOn(
    typeof(TaskSchedulingDomainModule),
    typeof(TaskSchedulingApplicationContractsModule),
    typeof(AbpDddApplicationModule),
    typeof(AbpAutoMapperModule),
    typeof(AbpBackgroundWorkersModule)
    )]
public class TaskSchedulingApplicationModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAutoMapperObjectMapper<TaskSchedulingApplicationModule>();
        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<TaskSchedulingApplicationModule>(validate: false);
        });
    }

    public override void OnApplicationInitialization(ApplicationInitializationContext context)
    {
        //context.AddBackgroundWorkerAsync<WorkflowWorker>();
        //context.AddBackgroundWorkerAsync<RedisConvertMqttWorker>();
        base.OnApplicationInitialization(context);
    }
}
